Skip to content

fix: more robust link message parsing#113

Merged
lorenzocorallo merged 2 commits intomainfrom
parse-message-links
Apr 13, 2026
Merged

fix: more robust link message parsing#113
lorenzocorallo merged 2 commits intomainfrom
parse-message-links

Conversation

@lorenzocorallo
Copy link
Copy Markdown
Member

No description provided.

@lorenzocorallo lorenzocorallo merged commit ced816a into main Apr 13, 2026
1 check was pending
@lorenzocorallo lorenzocorallo deleted the parse-message-links branch April 13, 2026 18:02
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Apr 13, 2026

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: f5e09cf2-fdc7-47de-8b57-f37eb64e2e1c

📥 Commits

Reviewing files that changed from the base of the PR and between c6f6274 and 56bb8c4.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (4)
  • package.json
  • src/bot.ts
  • src/lib/group-management/index.ts
  • src/middlewares/message-link.ts

Walkthrough

Dependency version updated for @polinetwork/backend, MessageLink middleware registration moved into the middleware chain, username field added to chat info extraction, and message link parsing refactored to use entity-based extraction with handle resolution via API lookup.

Changes

Cohort / File(s) Summary
Dependency Update
package.json
Updated @polinetwork/backend from ^0.15.17 to ^0.15.18.
Middleware Refactoring
src/bot.ts, src/middlewares/message-link.ts
MessageLink moved from standalone bot.on("message", ...) handler to middleware chain via bot.use(). Message link parsing refactored to extract links from message entities (url and text\_link) instead of regex scanning full text; new parseTelegramMessageLink() helper normalizes and resolves both t.me/c/<id>/<msg> and t.me/<handle>/<msg> URL formats with optional handle-to-ID resolution; makeResponse signature updated to accept original link string.
Data Model Updates
src/lib/group-management/index.ts
Added username field to stripChatInfo() return object from chat.username.

Possibly related PRs

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants